//
//  VIPRoomModel.m
//  TTProduct
//
//  Created by My mac on 2018/8/22.
//  Copyright © 2018年 TTProduct. All rights reserved.
//

#import "VIPRoomModel.h"

#import "VIPUserModel.h"
#import "VIPMutiLablesModel.h"
#import "VIPCodeCookiesModel.h"
#import "VIPMutiLablesModel.h"

@implementation VIPRoomModel

- (void)setTeacher:(VIPUserModel *)teacher {
    _teacher = teacher;
}

+ (NSDictionary *)mj_objectClassInArray {
    return @{@"students" : [VIPUserModel class],
             @"intoLessonurls" : [VIPMutiLablesModel class],
             @"vipCodeCookies" : [VIPCodeCookiesModel class],
             @"signals" : [VIPSignalModel class]
             };
}

- (NSString *)teacherDrawColor {
    if (_teacherDrawColor.length == 0) {
        _teacherDrawColor = @"#E51C23";
    }
    return _teacherDrawColor;
}

- (NSString *)colorString {
    if (_colorString.length == 0) {
        NSUInteger uid = self.uid;
        for (int i =0; i < self.students.count; i++) {
            VIPUserModel *student = self.students[i];
            if (uid != student.uid) continue;
            _colorString = self.studentsDrawColor[i];
        }
    }
    
    return _colorString;
}

- (NSArray *)studentsDrawColor {
    if (!_studentsDrawColor) {
        _studentsDrawColor = @[@"#FFC30B", @"#366EE1", @"#4AE55C", @"#A943F7"];
    }
    return _studentsDrawColor;
}

- (NSString *)lessonName {
    if (!_lessonName) return @"";
    return _lessonName;
}

- (NSString *)whiteboardurl {
    if (!_whiteboardurl) {
        _whiteboardurl = @"";
    }
    return _whiteboardurl;
}

- (NSString *)ppturl {
    if (!_ppturl) {
        _ppturl = @"";
    }
    return _ppturl;
}

@end
